var Main={scale:parseFloat(979)/parseFloat(1920)};
$(function(){
	Main.init();
});
//初始化
Main.init=function(){
	$(".nav_button").click(function(){
		if($(".header_menu").hasClass("menu_closed")){
			$(".header_menu").removeClass("menu_closed").addClass("menu_open");
			$(this).removeClass("nav_button_rotate");
		}else{
			$(".header_menu").removeClass("menu_open").addClass("menu_closed");
			$(this).addClass("nav_button_rotate");
		}
	});
	$(".section_1").css({"height":$(window).height()});
	setImgMax();
	$(window).resize(function(){//1920 x 1078
		setImgMax();
	});
}
//设置图片宽高比例
function setImgMax(){
	var winH=$(window).height();
	var winW=$(window).width();
	var scale2=winH/winW;
	if(Main.scale<scale2){
		$(".section_1>ul>li>img").css({"height":winH,"width":winH/Main.scale,top:0,left:-(winH/Main.scale-winW)/2});
	}else{
		$(".section_1>ul>li>img").css({"height":winW*Main.scale,"width":winW,top:-(winW*Main.scale-winH)/2,left:0});
	}
	$(".section_1").css({"height":$(window).height()});
}
